package s2elinshu;

public class J01Account {
	public static void main(String[] args) {
		// 은행 예금 처리 프로그램
		// 입력값 : 계좌번호, 통장잔액, 월이율, 연이율, 인출액, 입금액, 통장개설일
		// 변수 선언 및 초기화
		String aid = "1122";
		int balance = 0;
        double interestRate = 0;
		double getMonthlyInterestRate = 0;
		String dateCreated;
		int withDraw;
		int deposit;
		// 계산 및 연산
		dateCreated = "2014-03-11";
	    deposit = 0;
		withDraw = 0;
		getMonthlyInterestRate = interestRate / 12;
		balance = balance + deposit;  //입금
		balance = balance - withDraw;  //인출
		// 변수 초기화 없이 수식을 사용하면 오류발생!
				
		// 결과 출력
		System.out.println(aid);
		System.out.println(balance);
		System.out.println(getMonthlyInterestRate);
		System.out.println(dateCreated);
		System.out.println(withDraw);
		System.out.println(deposit);
		
		// 시험값 : 1122, 20000, 4.5, 2500인출, 3000인출
		aid = "1122";  // 계좌번호
		balance = 20000; // 잔액
		interestRate = 4.5; //연이율
		withDraw = 2500;
	    deposit = 3000;
	    
	    getMonthlyInterestRate = interestRate / 12;
	    balance = balance - withDraw;
	
	    System.out.println("결과확인용");
	    System.out.println(aid);
		System.out.println(balance);
		System.out.println(getMonthlyInterestRate);
		System.out.println(dateCreated);
		System.out.println(withDraw);
		System.out.println(deposit);
				
		// 날짜 : date로 쓰나, 아직 배우지 않아 String사용
		
		
		/* int d = 201403;
		int dateCreated = 201401;
		String aid = "1122";
		double balance = 20000;
		double interestRate = 4.5;
		double getMonthlyInterestRate = interestRate / 12;
		int withDraw = 2500;
		int deposit = 3000;
		System.out.println(aid);
		System.out.println(balance
				* (1 + (d - dateCreated) * getMonthlyInterestRate / 100) - withDraw
				- deposit );
		System.out.println(getMonthlyInterestRate + "%");
		System.out.println(dateCreated); */
			}
}